package com.ocom.exposeapi.feign;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.constant.AccessServiceUrl;
import com.ocom.common.resp.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "access")
public interface AccessService {

    @PostMapping(AccessServiceUrl.URL_getZyResult)
    Result getZyResult(@RequestParam("companyId") Long companyId ,@RequestParam("identity")String identity,@RequestParam("name") String name);

    @PostMapping(AccessServiceUrl.URL_FindMach)
    public Result FindMach(@Validated @RequestBody JSONObject jsonObject);


    @PostMapping(AccessServiceUrl.URL_getMachineInfoByMachNo)
    Result getMachineInfoById(@RequestParam("companyId")Long companyId,@RequestParam("machNo")String machNo);


    /**
     * 获取区域片区信息
     * */
    @PostMapping(AccessServiceUrl.URL_getAreaInfoByMachNo)
    Result getAreaInfoByMachNo(@RequestParam("companyId") Long companyId, @RequestParam("machNo") String machNo);

    @PostMapping(AccessServiceUrl.URL_getRegionInfo)
    Result getRegionInfo(@RequestBody JSONObject object);

    @GetMapping(AccessServiceUrl.URL_GetAreaInfo)
    public Result GetAreaInfo(@RequestParam("comId") Long comId,@RequestParam("regionId")Integer regionId,@RequestParam("areaId") Integer areaId,@RequestParam("areaName") String areaName);

}
